package com.readystatesoftware.chuck

import android.annotation.SuppressLint
import android.os.Bundle
import android.webkit.WebChromeClient
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.appcompat.app.AppCompatActivity

class WebViewActivity : AppCompatActivity() {

    @SuppressLint("SetJavaScriptEnabled")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_web_view)

        var webView = findViewById<WebView>(R.id.webView)

        var settings = webView.settings
        settings.javaScriptEnabled = true
        webView.setWebChromeClient(object: WebChromeClient() {

        })

        webView.setWebViewClient(object: WebViewClient() {

        })

        var data = intent.getStringExtra("data")

        webView.loadData(data,"text/html","UTF-8")
    }
}
